package com.aigc.sclassroom.service.impl;

import com.aigc.sclassroom.mapper.ClassMapper;
import com.aigc.sclassroom.pojo.Class;
import com.aigc.sclassroom.pojo.Result;
import com.aigc.sclassroom.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassServiceImpl implements ClassService {
    @Autowired
    private ClassMapper classMapper;


    @Override
    public Class addAndGet(Long courseManageId) {
        Class classObj = new Class();
        classObj.setCourseManageId(courseManageId);
        classMapper.add1(classObj);
        return classMapper.getClassById(classObj.getClassId());
    }

    @Override
    public void add(Long courseManageId) {
        classMapper.add(courseManageId);
    }
    @Override
    public List<Class> selectAllByCourseManageId(Long courseManageId) {
        return classMapper.selectAll(courseManageId);
    }
}
